//@author A0101032L

#include "help.h"
#include <vector>
#include <string> 

using namespace std;

help::help(){
	
	toUser = "";
 	
}
help::~help(void){
}


string help:: mainHelp(string command){

	if(command=="add") {
			
		helpAdd();		
	}

	else if(command=="delete"){

			helpDelete();
	} 

	else if(command=="search"){

			helpSearch();
	}
	else if(command=="display"){

			helpDisplay();
	}
	else if(command=="clear"){

			helpClear();
	}
	else if(command=="rename"){

			helpRename();
	}
	else if(command=="reschedule"){

			helpReschedule();
	}
	else if(command=="relocate"){

			helpRelocate();
	}
		
	else if(command=="mark"){

			helpMark();
	}
	else if(command=="unmark"){

			helpUnmark();
	}
	else if(command=="undo"){

			helpUndo();
	}
	else if(command=="redo"){

			helpRedo();
	}
	
	else {
	
			helpOverall();
	}
	
	return "";
}

void help::helpAdd(){
	
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"There are several ways to go about adding a task to ToDoIter."<<endl<<endl;
	cout<<"add ";
	SettingColor(12);
	cout<<"<taskname>";
	SettingColor(15);
	cout<<" from ";
	SettingColor(12);
	cout<<"<start date time> ";
	SettingColor(15);
	cout<<"to ";
	SettingColor(12);
	cout<<"<end date time>"<< endl;

	SettingColor(15);
	cout<<"add ";
	SettingColor(12);
	cout<<"<taskname>";
	SettingColor(15);
	cout<<" on ";
	SettingColor(12);
	cout<<"<date/day> ";
	SettingColor(15);
	cout<<" from ";
	SettingColor(12);
	cout<<"<start date time> ";
	SettingColor(15);
	cout<<"to ";
	SettingColor(12);
	cout<<"<end date time>"<< endl;

	SettingColor(15);
	cout<<"add ";
	SettingColor(12);
	cout<<"<taskname>";
	SettingColor(15);
	cout<<" by ";
	SettingColor(12);
	cout<<"<date/day> "<<endl<<endl;
	

	SettingColor(15);
	cout<<"1) add Dinner with BFF from 8pm to 10pm on 31/5/2014"<<endl;
	cout<<"2) a final exam on Tuesday from 10am to 1200"<<endl;
	cout<<"3) add Submit assignment 1 by tomorrow 3pm"<<endl<<endl;
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
	cout<<"Supported date-time format"<<endl;
	cout<<"Keywords such as today, tmr(tomorrow), Monday-Sunday, Mon-Sun"<<endl;
	cout<<"In place of add, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<a>"<<endl<<endl;
	SettingColor(15);
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;


}

void help::helpDelete(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To delete a task, simply write ";
	SettingColor(12);
	cout<<"<delete> ";
	SettingColor(15);
	cout<<"followed by the task name"<<endl;
	cout<<"1) delete dinner with BFF"<<endl;
	cout<<"In place of delete, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<del>"<<endl<<endl;
	SettingColor(15);
	cout<<"After search or display, it is also possible to use the ID number to delete a task."<<endl;
	cout<<"Ex.<delete 1> will delete the first task in the list. "<<endl;
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;

}

void help::helpSearch(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"There are various features involved with search in our project. "<<endl;
	cout<<"To simply search for a task, simple type ";
	SettingColor(12);
	cout<<"<search> ";
	SettingColor(15);
	cout<<"followed by the task name"<<endl;

	cout<<"To search for empty slots in a particular time range, type ";
	SettingColor(12);
	cout<<"<search empty> <from> <start time> <to> <end time>"<<endl;
	SettingColor(15);

	cout<<"To search for tasks in a particular time range, type ";
	SettingColor(12);
	cout<<"<search range> <from> <start time> <to> <end time>"<<endl;
	SettingColor(15);
	
	cout<<"In place of search, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<s>"<<endl<<endl;
	SettingColor(15);
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;

}

void help:: helpDisplay(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To display the tasks, simply type ";
	SettingColor(12);
	cout<<"<display> ";
	SettingColor(15);
	cout<<"and voila!"<<endl;

	cout<<"To display the tasks due today, simply type ";
	SettingColor(12);
	cout<<"<display today>"<<endl;
	SettingColor(15);
	cout<<"After search or display, it is also possible to use the ID number to get the detailed display of a task."<<endl;
	cout<<"Ex.<display 1> will give a detailed display of the first task in the list."<<endl;
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;

}
void help::helpClear(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To clear all the current tasks, simple type ";
	SettingColor(12);
	cout<<"<clear>"<<endl;
	SettingColor(15);
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;

}

void help::helpRename(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To rename a certain task, simple type ";
	SettingColor(12);
	cout<<"<rename> ";
	SettingColor(15);
	cout<<"followed by the old task name ";
	SettingColor(12);
	cout<<"> ";
	SettingColor(15);
	cout<<"and then the new task name"<<endl;
	cout<<"rename test < test_Renamed"<<endl;

	cout<<"In place of rename, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<rn>"<<endl<<endl;
	SettingColor(15);
	cout<<"After search or display, it is also possible to use the ID number to rename a task."<<endl;
	cout<<"Ex.<rename 1 > hello> will rename the first task in the list to hello "<<endl;
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
}
	
void help::helpReschedule(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To reschedule a certain task, simple type ";
	SettingColor(12);
	cout<<"<reschedule> ";
	SettingColor(15);
	cout<<"followed by the task name and the new time of the task"<<endl;
	SettingColor(12);
	cout<<"reschedule test by Sunday ";
	SettingColor(15);
	cout<<"will reschedule the task test to be due by Sunday"<<endl;
	cout<<"In place of reschedule, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<rs>"<<endl<<endl;
	SettingColor(15);
	cout<<"After search or display, it is also possible to use the ID number to reschedule a task."<<endl;
	cout<<"Ex.<reschedule 1 by Sunday> will reschedule the first task in the list to by due by Sunday "<<endl;
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	

}

void help::helpRelocate(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To relocate a certain task, simple type ";
	SettingColor(12);
	cout<<"<relocate> ";
	SettingColor(15);
	cout<<"followed by the task name and then the new location"<<endl;
	SettingColor(12);
	cout<<"relocate test NUS";
	SettingColor(15);
	cout<<" will relocate the task test to NUS "<<endl;
	cout<<"In place of relocate, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<rl>"<<endl<<endl;
	SettingColor(15);
	cout<<"After search or display, it is also possible to use the ID number to relocate a task."<<endl;
	cout<<"Ex.<relocate 1 to NUS> will relocate the first task in the list to NUS. "<<endl;
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
}

void help::helpMark(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To mark a certain task as done, simple type ";
	SettingColor(12);
	cout<<"<mark> ";
	SettingColor(15);
	cout<<"followed by the task name"<<endl;
	cout<<"mark test"<<endl;
	cout<<"In place of mark, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<m>"<<endl<<endl;
	SettingColor(15);
	cout<<"After search or display, it is also possible to use the ID number to mark a task."<<endl;
	cout<<"Ex.<mark 1> will mark the first task in the list as done"<<endl;
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;

}
void help::helpUnmark(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To mark a certain task as undone, simple type ";
	SettingColor(12);
	cout<<"<unmark> ";
	SettingColor(15);
	cout<<"followed by the task name"<<endl;
	cout<<"unmark test"<<endl;
	cout<<"In place of unmark, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<um>"<<endl<<endl;
	SettingColor(15);
	cout<<"After search or display, it is also possible to use the ID number to unmark a task."<<endl;
	cout<<"Ex.<unmark 1> will mark the first task in the list as undone"<<endl;
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;



}
void help::helpUndo(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To undo any command, simple type ";
	SettingColor(12);
	cout<<"<undo>"<<endl;
	SettingColor(15);
	cout<<"In place of undo, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<u>"<<endl<<endl;
	SettingColor(15);
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;


}


void help::helpRedo(){

	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;
	cout<<"To redo any command, simple type ";
	SettingColor(12);
	cout<<"<redo>"<<endl;
	SettingColor(15);
	cout<<"In place of redo, it is also possible to use short form ";
	SettingColor(12);
	cout<<"<re>"<<endl<<endl;
	SettingColor(15);
	cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl;


}


void help::helpOverall(){

	

	cout<<"Welcome to the help page for ToDoItter"<<endl;
	cout<<"For detailed help on add, please type \"help add\""<<endl;
	cout<<"For detailed help on delete, please type \"help delete\""<<endl;
	cout<<"For detailed help on search, please type \"help search\""<<endl;
	cout<<"For detailed help on display, please type \"help display\""<<endl;
	cout<<"For detailed help on clear, please type \"help clear\""<<endl;
	cout<<"For detailed help on rename, please type \"help rename\""<<endl;
	cout<<"For detailed help on reschedule, please type \"help reschedule\""<<endl;
	cout<<"For detailed help on relocate, please type \"help relocate\""<<endl;
	cout<<"For detailed help on mark, please type \"help mark\""<<endl;
	cout<<"For detailed help on unmark, please type \"help unmark\""<<endl;
	cout<<"For detailed help on undo, please type \"help undo\""<<endl;
	cout<<"For detailed help on redo, please type \"help redo\""<<endl;
	

}

void help::SettingColor(int value){
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),  value);
}

